package com.jason.designpattern.singleton;

/**
 * @description: 饿汉模式
 * 优点：线程安全；没有加锁，执行效率会提高
 * 缺点：没有实现懒加载；类加载时就初始化，浪费内存
 * @author: jason.jia
 * @create: 2019-03-06 15:34
 **/
public class HungrySingleton {

    private static HungrySingleton instance = new HungrySingleton();

    private HungrySingleton(){

    }

    public static HungrySingleton getInstance(){
        return instance;
    }
}
